#!/bin/bash

base64 -w 0 dave.wav > dave_wav.txt
BASE64_ENCODED_AUDIO_DATA=$(cat dave_wav.txt)

# 音频输入请求
curl -X POST http://localhost:18012/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "fara",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "What'\''s in this audio?"
          },
          {
            "type": "input_audio",
            "input_audio": {
              "data": "$BASE64_ENCODED_AUDIO_DATA",
              "format": "wav"
            }
          }
        ]
      }
    ],
    "max_tokens": 2000
  }'